home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 71 / maccd 71.iso / macware / CDFinder 2.8.1 / Extras / CDFinder & AppleScript next >
Encoding:
Text File  |  2000-07-07  |  9.6 KB  |  159 lines  |  [TEXT/ttxt]

  1. This document explains some of the details of the current AppleScript implementation
  2. Release: CDFinder 2.8.1
  3.  
  4. Future versions will include even more support. If you have suggestions, please let me know!
  5.  
  6. ===========================================================
  7.  
  8. The new version 2.8.1 of CDFinder has again an extended AppleScript ability.
  9. It is now possible to access the basic catalog and catalog folder info in a real object structured manner. Here is the new part of the dictionary. In addition, the preferences section contains two new properties that contain the number of catalogs and catalog folders. I know, I should have included a count command, but the implementation of it was much more complicated than I thought and I will add it in a later version.
  10.  
  11. As you can see, you can change the name, the comment, the label, and the selection of a catalog and also a catalog folder. It is also possible to open or close a catalog folder by changing the is open property.
  12.  
  13. The actual contents of a catalog will be revealed in a later version!
  14.  
  15. A new event will reveal a catalog or catalog folder in the main window. That event will of course later be used for other classes, too. Starting with 2.8.1, this now includes Found Items.
  16.  
  17. show: Bring an object into view
  18.     show  reference  -- The object to be made visible
  19.  
  20. ===========================================================
  21.  
  22. Class catalog: one catalog file
  23. Plural form:
  24.     catalogs
  25. Properties:
  26.     ID  integer  [r/o]  -- unique ID of this catalog. Only valid during one run of CDFinder!
  27.     name  text  -- the name of the catalog as the user sees it
  28.     volume name  text  [r/o]  -- name of the original volume
  29.     file name  text  [r/o]  -- name of the actual catalog file, usually the same a the name of the catalog
  30.     comment  text  -- the comment that the user has entered
  31.     label  small integer  -- the label of the catalog. 0 is none
  32.     filenumber  integer  [r/o]  -- number of files in the catalog
  33.     foldernumber  integer  [r/o]  -- number of folders in the catalog
  34.     volume size  integer  [r/o]  -- the size of the volume in KB
  35.     free space  integer  [r/o]  -- the free space on that volume in KB
  36.     formatted  date  [r/o]  -- the date and time when the volume was formatted (created)
  37.     modified  date  [r/o]  -- the date and time when the volume was last modified
  38.     catalog created  date  [r/o]  -- the creation date and time of this catalog
  39.     catalog folder ID  integer  [r/o]  -- The ID of the catalog folder that contains this catalog. Is zero if the catalog lies in the top level.
  40.     selected  boolean  -- is the catalog selected in the main window?
  41.  
  42. Class catalog folder: a folder that contains catalog files
  43. Plural form:
  44.     catalog folders
  45. Properties:
  46.     name  text  -- the name of the catalog folder
  47.     comment  text  -- the user comment
  48.     ID  integer  [r/o]  -- the ID of this catalog folder. Unique duringe one run of CDFinder.
  49.     label  small integer  -- The label of this catalog folder
  50.     created  date  [r/o]  -- The date and time of the creation of this catalog folder.
  51.     modified  date  [r/o]  -- The date and time of the last modification of this catalog folder
  52.     is open  boolean  -- Is this catalog folder open?
  53.     selected  boolean  -- is the catalog folder selected in the main window?
  54.  
  55.  
  56. Class found item : an item in the Found Items window
  57. Properties:
  58.     ID integer  [r/o]  -- the unique ID of this item. Only valid until a new Find operation is invoked!
  59.     name text  [r/o]  -- the name of this item
  60.     folder boolean  [r/o]  -- if true, the item is a folder, otherwise a file
  61.     label small integer  -- the label of this item
  62.     created date  [r/o]  -- The date and time of the creation of this item
  63.     modified date  [r/o]  -- The date and time of the last modification of this item
  64.     size integer  [r/o]  -- the size of the file in KB, but of course only if it is a file!
  65.     file type type class  [r/o]  -- the four character c of the item, if it is a file
  66.     creator type type class  [r/o]  -- the four character creator code of the item, if it is a file
  67.     catalogID integer  [r/o]  -- the ID of the catalog that contains this item.
  68.     selected boolean  -- is the item selected in the Found Items window?
  69.     full path text  [r/o]  -- the full path of the found item
  70.  
  71.  
  72. ===========================================================
  73.  
  74. Class application: CDFinder's preferences
  75. Elements:
  76.     catalog by numeric index, by ID, by name
  77.     catalog folder by numeric index, by ID, by name
  78. Properties:
  79.     name  international text  [r/o]  -- the application’s name
  80.     frontmost  boolean  [r/o]  -- Is CDFinder the frontmost process?
  81.     version  international text  [r/o]  -- the version of CDFinder
  82.     global catalog folder  alias  -- an alias to the main catalog folder
  83.     language  Deutsch/English/Francais/Italian/Swedish/Chinese/Japanese  -- the language of the user interface
  84.     play sound  boolean  -- should CDFinder play a sound after long operations?
  85.     label1  international text  -- the name of label 1
  86.     label2  international text  -- the name of label 2
  87.     label3  international text  -- the name of label 3
  88.     label4  international text  -- the name of label 4
  89.     label5  international text  -- the name of label 5
  90.     label6  international text  -- the name of label 6
  91.     label7  international text  -- the name of label 7
  92.     main display size  boolean  -- display a column with the size of a volume in the main window
  93.     main display unused  boolean  -- display a column with the unused space of a volume in the main window
  94.     main display label  boolean  -- display a column with the label of a volume in the main window
  95.     main display modification date  boolean  -- display a column with the modification date of a volume in the main window
  96.     main display comment  boolean  -- display a column with the comment of a volume in the main window
  97.     catalog display size  boolean  -- display a column with the size of an item in a catalog window
  98.     catalog display filetype  boolean  -- display a column with the filetype of an item in a catalog window
  99.     catalog display creator  boolean  -- display a column with the creator code of an item in a catalog window
  100.     catalog display modification date  boolean  -- display a column with the modification date of an item in a catalog window
  101.     catalog display creation date  boolean  -- display a column with the creation date of an item in a catalog window
  102.     catalog display label  boolean  -- display a column with the label of an item in a catalog window
  103.     catalog display icons  boolean  -- display the Finder icon of any item in a catalog window (slower!)
  104.     catalog display catalog name  boolean  -- display a column with the catalog name of an item in the found items window
  105.     ignore invisibles  boolean  -- creating a new catalog: ignore invisible files
  106.     ignore icons  boolean  -- creating a new catalog: ignore icons files
  107.     open StuffIt  boolean  -- creating a new catalog: open StuffIt files
  108.     open CompactPro  boolean  -- creating a new catalog: open Compact Pro files
  109.     catalog number  integer  [r/o]  -- the number of catalog files 
  110.     catalog folder number  integer  [r/o]  -- the number of catalog folders known to the application
  111.     found items number integer  [r/o]  -- the number of items currently found
  112.  
  113.  
  114. ===========================================================
  115.  
  116. find in: start a new Find operation
  117.     find in  all catalogs/selected catalogs/catalogs without label/catalogs with label 1/catalogs with label 2/catalogs with label 3/catalogs with label 4/catalogs with label 5/catalogs with label 6/catalogs with label 7/found items  -- the selection of catalog files to be searched
  118.         first kind  theName/filetype/creator/size/creation date/modification date/label  -- kind of first value to be found
  119.         [first comparison  fIs/fIsNot/fContains/fContainsNot/fBeginsWith/fEndsWith/fMoreThan/fLessThan/fEarlierThan/fLaterThan]  -- how to compare the value
  120.         first value  reference  -- find String, or filetype, or creator, or size or whatever
  121.         [operator  findAND/findOR]  -- if two find values: how to combine them
  122.         [second kind  theName/filetype/creator/size/creation date/modification date/label]  -- kind of second value to be found
  123.         [second comparison  fIs/fIsNot/fContains/fContainsNot/fBeginsWith/fEndsWith/fMoreThan/fLessThan/fEarlierThan/fLaterThan]  -- how to compare the second value
  124.         [second value  reference]  -- find String, or filetype, or creator, or size or whatever
  125.         [add to found  boolean]  -- add the new results to the already found items, if any
  126.         [start find  boolean]  -- if true, then start find process immediately. If false, just set the values and activate the Find window.
  127.     [Result:   integer]  -- number of found items, or 0 if start find is false
  128.  
  129.  
  130.  
  131.  
  132. ===========================================================
  133. --  This is a short sample how to tell CDFinder to create catalog files of all local disks
  134. --  By Norbert M. Doerner 1999
  135.  
  136. tell application "Finder"
  137.     set volumeList to every disk as list
  138. end tell
  139.  
  140. tell application "CDFinder"
  141.     repeat with oneDisk in volumeList
  142.         set oneAlias to oneDisk as alias --  CDFinder needs an alias of the disk
  143.         with timeout of 500 seconds --  remember: this might take more than the default 60 seconds!
  144.             set myResult to create catalog of (oneAlias) --  use standard settings and do not update or duplicate
  145.         end timeout
  146.         if myResult = -128 then -- then the catalog might be already there
  147.         end if
  148.     end repeat
  149. end tell
  150.  
  151. --  PLEASE NOTE:
  152. --  If you have any ideas or suggestions or even better, code samples, please tell me!
  153.  
  154. --  Secret commands:
  155. --  By opening the preferences file, CDFinder will open the window to let you change the preferences.
  156. --  By opening any catalog file that is stored inside the catalog folder, CDFinder will open it
  157. --    and display its contents.
  158. --  These secret commands will go away once I figure out how to use properties and the 
  159. --   get/set data commands.